﻿<UserControl x:Class="cmdr.Editor.Views.Controls.ConditionControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="50" d:DesignWidth="400">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="boolToVisConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="2"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="50" />
        </Grid.ColumnDefinitions>
        <TextBlock Text="{Binding Name}" Grid.Row="0" VerticalAlignment="Center" TextAlignment="Left" HorizontalAlignment="Left" />
        <DockPanel Grid.Row="2">
            <ComboBox DockPanel.Dock="Left" ItemsSource="{Binding AssignmentOptions, Mode=OneWay}" SelectedItem="{Binding Assignment}" MinWidth="30"
                  Visibility="{Binding IsNotGlobal, Converter={StaticResource boolToVisConverter}}" />
            <ComboBox DockPanel.Dock="Right" ItemsSource="{Binding ValueOptions, Mode=OneWay}" SelectedItem="{Binding Value}" MinWidth="40"/>
        </DockPanel>
    </Grid>
</UserControl>

